package com.example.WebSocketDemo.service.impl;

import com.example.WebSocketDemo.bean.User;
import com.example.WebSocketDemo.mapper.UserMapper;
import com.example.WebSocketDemo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("userService")
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> getAllUser() {
        return userMapper.getAllUser();
    }

    @Override
    public User login(User user) {
        return userMapper.login(user.getUsername(),user.getPassword());
    }

    @Override
    public List<User> getUserFriend(String userId) {
        return userMapper.getUserFriend(userId);
    }

    @Override
    public User getUserInfoById(String id) {
        return userMapper.getUserInfoById(id);
    }

    @Override
    public void userRegister(User user) {
        userMapper.userRegister(user);
    }

    @Override
    public List<User> searchUser(String info) {
        return userMapper.searchUser(info);
    }

    @Override
    public void modifyUserInfo(User user) {
        userMapper.modifyUserInfo(user);
    }
}
